using System;
using System.Data;
using System.Collections.Generic;
using ADOBase;

namespace eTMS.DAO{
	/********************************BEGIN LichHocLopTinChiDAO****************************************/
	///<summary>
	/// <para>Author: Auto generated class by CSharp Code Generator v2.0</para>
	/// <para>Date:24/02/2012 20:02:25</para>
	/// <para>Class Name: LichHocLopTinChiDAO</para>
	/// <para>Description: Class access to table LichHocLopTinChi in database. Coder should'nt code here.</para>
	///</summary>

	
	public partial class LichHocLopTinChiDAO : DAOBase<LichHocLopTinChiEntity>{


		#region Select functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:24/02/2012 20:02:25</para>
		/// <para>Name: CreateSelectOneCommand</para>
		/// <para>Input: LichHocLopTinChi_ID</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectOneCommand(int LichHocLopTinChi_ID){
			string strSQL="SELECT  [LichHocLopTinChi_ID],[TietHoc_ID],[TuanHoc_ID],[ThuTrongTuan_ID],[PhongHoc_ID],[GiangVienLopTinChi_ID] FROM [LichHocLopTinChi]  WHERE [LichHocLopTinChi].[LichHocLopTinChi_ID]=@LichHocLopTinChi_ID";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@LichHocLopTinChi_ID",LichHocLopTinChi_ID);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:24/02/2012 20:02:25</para>
		/// <para>Name: SelectOne</para>
		/// <para>Input: LichHocLopTinChi_ID</para>
		/// <para>Output: LichHocLopTinChiEntity</para>
		///</summary>
		public LichHocLopTinChiEntity SelectOne(int LichHocLopTinChi_ID){
			IDbCommand cmd=this.CreateSelectOneCommand(LichHocLopTinChi_ID);
			return this.Select(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:24/02/2012 20:02:25</para>
		/// <para>Name: CreateSelectAllCommand</para>
		/// <para>Input: </para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectAllCommand(){
			string strSQL="SELECT  [LichHocLopTinChi_ID],[TietHoc_ID],[TuanHoc_ID],[ThuTrongTuan_ID],[PhongHoc_ID],[GiangVienLopTinChi_ID] FROM [LichHocLopTinChi] ";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:24/02/2012 20:02:25</para>
		/// <para>Name: CreateSelectAllByKeyCommand</para>
		/// <para>Input: ColumnName,ColumnValue</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectAllByKeyCommand(string ColumnName,object Value){
			string strSQL="SELECT  [LichHocLopTinChi_ID],[TietHoc_ID],[TuanHoc_ID],[ThuTrongTuan_ID],[PhongHoc_ID],[GiangVienLopTinChi_ID] FROM [LichHocLopTinChi]  WHERE [LichHocLopTinChi].["+ColumnName+"]=@ColumnName";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@ColumnName",Value);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:24/02/2012 20:02:25</para>
		/// <para>Name: SelectAll</para>
		/// <para>Input: </para>
		/// <para>Output: List of LichHocLopTinChiEntity</para>
		///</summary>
		public List<LichHocLopTinChiEntity> SelectAll(){
			IDbCommand cmd=this.CreateSelectAllCommand();
			return this.SelectList(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:24/02/2012 20:02:25</para>
		/// <para>Name: SelectAllDS</para>
		/// <para>Input: </para>
		/// <para>Output: DataSet</para>
		///</summary>
		public DataSet SelectAllDS(){
			IDbCommand cmd=this.CreateSelectAllCommand();
			return this.SelectDS(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:24/02/2012 20:02:25</para>
		/// <para>Name: CreateSelectAllFilterCommand</para>
		/// <para>Input: </para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectAllFilterCommand(string strFilter){
			string strSQL="SELECT  [LichHocLopTinChi_ID],[TietHoc_ID],[TuanHoc_ID],[ThuTrongTuan_ID],[PhongHoc_ID],[GiangVienLopTinChi_ID] FROM [LichHocLopTinChi]  WHERE "+RemoveInjection(strFilter);
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:24/02/2012 20:02:25</para>
		/// <para>Name: CreateSelectAllByKeyFilterCommand</para>
		/// <para>Input: ColumnName,ColumnValue</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectAllByKeyFilterCommand(string strFilter,string ColumnName,object Value){
			string strSQL="SELECT  [LichHocLopTinChi_ID],[TietHoc_ID],[TuanHoc_ID],[ThuTrongTuan_ID],[PhongHoc_ID],[GiangVienLopTinChi_ID] FROM [LichHocLopTinChi]  WHERE [LichHocLopTinChi].["+ColumnName+"]=@ColumnName AND "+RemoveInjection(strFilter);
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@ColumnName",Value);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:24/02/2012 20:02:25</para>
		/// <para>Name: SelectAll</para>
		/// <para>Input: </para>
		/// <para>Output: List of LichHocLopTinChiEntity</para>
		///</summary>
		public List<LichHocLopTinChiEntity> SelectAllFilter(string strFilter){
			IDbCommand cmd=this.CreateSelectAllFilterCommand(strFilter);
			return this.SelectList(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:24/02/2012 20:02:25</para>
		/// <para>Name: SelectAllDSFilter</para>
		/// <para>Input: </para>
		/// <para>Output: DataSet</para>
		///</summary>
		public DataSet SelectAllDSFilter(string strFilter){
			IDbCommand cmd=this.CreateSelectAllFilterCommand(strFilter);
			return this.SelectDS(cmd);
		}
		#endregion

		#region Insert functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:24/02/2012 20:02:25</para>
		/// <para>Name: CreateInsertCommand</para>
		/// <para>Input: LichHocLopTinChiEntity</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateInsertCommand(LichHocLopTinChiEntity o){
			string strSQL="INSERT INTO [LichHocLopTinChi]([TietHoc_ID],[TuanHoc_ID],[ThuTrongTuan_ID],[PhongHoc_ID],[GiangVienLopTinChi_ID]) VALUES  (@TietHoc_ID,@TuanHoc_ID,@ThuTrongTuan_ID,@PhongHoc_ID,@GiangVienLopTinChi_ID);SELECT  @@IDENTITY";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			if(o.IsNullTietHoc_ID)
				this.CreateCommandParameter(cmd,"@TietHoc_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@TietHoc_ID",o.TietHoc_ID);

			if(o.IsNullTuanHoc_ID)
				this.CreateCommandParameter(cmd,"@TuanHoc_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@TuanHoc_ID",o.TuanHoc_ID);

			if(o.IsNullThuTrongTuan_ID)
				this.CreateCommandParameter(cmd,"@ThuTrongTuan_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@ThuTrongTuan_ID",o.ThuTrongTuan_ID);

			if(o.IsNullPhongHoc_ID)
				this.CreateCommandParameter(cmd,"@PhongHoc_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@PhongHoc_ID",o.PhongHoc_ID);

			if(o.IsNullGiangVienLopTinChi_ID)
				this.CreateCommandParameter(cmd,"@GiangVienLopTinChi_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@GiangVienLopTinChi_ID",o.GiangVienLopTinChi_ID);


			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:24/02/2012 20:02:25</para>
		/// <para>Name: Save</para>
		/// <para>Input: LichHocLopTinChiEntity</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool Save(LichHocLopTinChiEntity o){
			bool result=false;
			IDbCommand cmd=this.CreateInsertCommand(o);
			object id=this.ExecuteScalar(cmd,ref result);
			cmd.Dispose();
			try{
				o.LichHocLopTinChi_ID=int.Parse(Convert.ToString(id));
			}
			catch{}
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:24/02/2012 20:02:25</para>
		/// <para>Name: SaveList</para>
		/// <para>Input: List of LichHocLopTinChiEntity</para>
		/// <para>Output: </para>
		///</summary>
		public void SaveList(List<LichHocLopTinChiEntity>list){
			foreach(LichHocLopTinChiEntity o in list){
				try{
					this.Save(o);
				}
				catch{
				}
			}
		}
		#endregion

		#region Update functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:24/02/2012 20:02:25</para>
		/// <para>Name: CreateUpdateCommand</para>
		/// <para>Input: LichHocLopTinChiEntity</para>
		/// <para>Output: </para>
		///</summary>
		protected IDbCommand CreateUpdateCommand(LichHocLopTinChiEntity o){
			string strSQL="UPDATE  [LichHocLopTinChi] SET [LichHocLopTinChi].[TietHoc_ID]=@TietHoc_ID,[LichHocLopTinChi].[TuanHoc_ID]=@TuanHoc_ID,[LichHocLopTinChi].[ThuTrongTuan_ID]=@ThuTrongTuan_ID,[LichHocLopTinChi].[PhongHoc_ID]=@PhongHoc_ID,[LichHocLopTinChi].[GiangVienLopTinChi_ID]=@GiangVienLopTinChi_ID WHERE [LichHocLopTinChi].[LichHocLopTinChi_ID]=@LichHocLopTinChi_ID";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			if(o.IsNullLichHocLopTinChi_ID)
				this.CreateCommandParameter(cmd,"@LichHocLopTinChi_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@LichHocLopTinChi_ID",o.LichHocLopTinChi_ID);

			if(o.IsNullTietHoc_ID)
				this.CreateCommandParameter(cmd,"@TietHoc_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@TietHoc_ID",o.TietHoc_ID);

			if(o.IsNullTuanHoc_ID)
				this.CreateCommandParameter(cmd,"@TuanHoc_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@TuanHoc_ID",o.TuanHoc_ID);

			if(o.IsNullThuTrongTuan_ID)
				this.CreateCommandParameter(cmd,"@ThuTrongTuan_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@ThuTrongTuan_ID",o.ThuTrongTuan_ID);

			if(o.IsNullPhongHoc_ID)
				this.CreateCommandParameter(cmd,"@PhongHoc_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@PhongHoc_ID",o.PhongHoc_ID);

			if(o.IsNullGiangVienLopTinChi_ID)
				this.CreateCommandParameter(cmd,"@GiangVienLopTinChi_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@GiangVienLopTinChi_ID",o.GiangVienLopTinChi_ID);


			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:24/02/2012 20:02:25</para>
		/// <para>Name: CreateUpdateFieldCommand</para>
		/// <para>Input: ColumnName,ColumnValue,LichHocLopTinChi_ID</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateUpdateFieldCommand(string ColumnName,object Value,int LichHocLopTinChi_ID){
			string strSQL="UPDATE  [LichHocLopTinChi] SET [LichHocLopTinChi].["+ColumnName+"]=@ColumnName WHERE [LichHocLopTinChi].[LichHocLopTinChi_ID]=@LichHocLopTinChi_ID";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@LichHocLopTinChi_ID",LichHocLopTinChi_ID);



			this.CreateCommandParameter(cmd,"@ColumnName",Value);


			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:24/02/2012 20:02:25</para>
		/// <para>Name: Update</para>
		/// <para>Input: LichHocLopTinChiEntity</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool Update(LichHocLopTinChiEntity o){
			IDbCommand cmd=this.CreateUpdateCommand(o);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:24/02/2012 20:02:25</para>
		/// <para>Name: UpdateList</para>
		/// <para>Input: List of LichHocLopTinChiEntity</para>
		/// <para>Output: </para>
		///</summary>
		public void UpdateList(List<LichHocLopTinChiEntity>list){
			foreach(LichHocLopTinChiEntity o in list){
				try{
					this.Update(o);
				}
				catch{
				}
			}
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:24/02/2012 20:02:25</para>
		/// <para>Name: UpdateTietHoc_ID</para>
		/// <para>Input: NewTietHoc_ID,LichHocLopTinChi_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateTietHoc_ID(int NewTietHoc_ID,int LichHocLopTinChi_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("TietHoc_ID",NewTietHoc_ID,LichHocLopTinChi_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:24/02/2012 20:02:25</para>
		/// <para>Name: UpdateTuanHoc_ID</para>
		/// <para>Input: NewTuanHoc_ID,LichHocLopTinChi_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateTuanHoc_ID(int NewTuanHoc_ID,int LichHocLopTinChi_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("TuanHoc_ID",NewTuanHoc_ID,LichHocLopTinChi_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:24/02/2012 20:02:25</para>
		/// <para>Name: UpdateThuTrongTuan_ID</para>
		/// <para>Input: NewThuTrongTuan_ID,LichHocLopTinChi_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateThuTrongTuan_ID(int NewThuTrongTuan_ID,int LichHocLopTinChi_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("ThuTrongTuan_ID",NewThuTrongTuan_ID,LichHocLopTinChi_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:24/02/2012 20:02:25</para>
		/// <para>Name: UpdatePhongHoc_ID</para>
		/// <para>Input: NewPhongHoc_ID,LichHocLopTinChi_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdatePhongHoc_ID(int NewPhongHoc_ID,int LichHocLopTinChi_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("PhongHoc_ID",NewPhongHoc_ID,LichHocLopTinChi_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:24/02/2012 20:02:25</para>
		/// <para>Name: UpdateGiangVienLopTinChi_ID</para>
		/// <para>Input: NewGiangVienLopTinChi_ID,LichHocLopTinChi_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateGiangVienLopTinChi_ID(int NewGiangVienLopTinChi_ID,int LichHocLopTinChi_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("GiangVienLopTinChi_ID",NewGiangVienLopTinChi_ID,LichHocLopTinChi_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		#endregion

		#region Delete functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:24/02/2012 20:02:25</para>
		/// <para>Name: DeleteAllCommand</para>
		/// <para>Input: </para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateDeleteAllCommand(){
			string strSQL="DELETE   FROM [LichHocLopTinChi]  ";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:24/02/2012 20:02:25</para>
		/// <para>Name: DeleteCommand</para>
		/// <para>Input: LichHocLopTinChiEntity</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateDeleteCommand(LichHocLopTinChiEntity o){
			string strSQL="DELETE   FROM [LichHocLopTinChi]   WHERE [LichHocLopTinChi].[LichHocLopTinChi_ID]=@LichHocLopTinChi_ID";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			if(o.IsNullLichHocLopTinChi_ID)
				this.CreateCommandParameter(cmd,"@LichHocLopTinChi_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@LichHocLopTinChi_ID",o.LichHocLopTinChi_ID);


			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:24/02/2012 20:02:25</para>
		/// <para>Name: DeleteAll</para>
		/// <para>Input: </para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool DeleteAll(){
			IDbCommand cmd=this.CreateDeleteAllCommand();
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:24/02/2012 20:02:25</para>
		/// <para>Name: CreateDeleteByPrimaryKeyCommand</para>
		/// <para>Input: LichHocLopTinChi_ID</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateDeleteByPrimaryKeyCommand(int LichHocLopTinChi_ID){
			string strSQL="DELETE   FROM [LichHocLopTinChi]   WHERE [LichHocLopTinChi].[LichHocLopTinChi_ID]=@LichHocLopTinChi_ID";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@LichHocLopTinChi_ID",LichHocLopTinChi_ID);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:24/02/2012 20:02:25</para>
		/// <para>Name: CreateDeleteByKeyCommand</para>
		/// <para>Input: ColumnName , ColumnValue</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateDeleteByKeyCommand(string ColumnName,object Value){
			string strSQL="DELETE   FROM [LichHocLopTinChi]   WHERE [LichHocLopTinChi].["+ColumnName+"]=@ColumnName";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@ColumnName",Value);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:24/02/2012 20:02:25</para>
		/// <para>Name: Delete</para>
		/// <para>Input: LichHocLopTinChiEntity</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool Delete(LichHocLopTinChiEntity o){
			IDbCommand cmd=this.CreateDeleteCommand(o);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:24/02/2012 20:02:25</para>
		/// <para>Name: DeleteByID</para>
		/// <para>Input: LichHocLopTinChi_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool DeleteByID(int LichHocLopTinChi_ID){
			IDbCommand cmd=this.CreateDeleteByPrimaryKeyCommand(LichHocLopTinChi_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		#endregion

		#region Select join to GiangVienLopTinChiThuTrongTuan functions
		#endregion

		#region Select join to GiangVienLopTinChi functions
		#endregion

		#region Select join to ThuTrongTuan functions
		#endregion

		#region Select,delete by LichHocLopTinChi_ID functions
		#endregion

		#region Select,delete by ThuTrongTuan_ID functions
		#endregion

		#region Select,delete by GiangVienLopTinChi_ID functions
		#endregion

		#region MapObject functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:24/02/2012 20:02:25</para>
		/// <para>Name: MapObject</para>
		/// <para>Input: IDataReader</para>
		/// <para>Output: LichHocLopTinChiEntity</para>
		///</summary>
		protected override LichHocLopTinChiEntity MapObject(IDataReader r){
			LichHocLopTinChiEntity entity = new LichHocLopTinChiEntity();
			try{
				if(r.FieldCount>0){
					try
					{
						int ordinal = r.GetOrdinal("LichHocLopTinChi_ID");
						if (!r.IsDBNull(ordinal)) entity.LichHocLopTinChi_ID = ((int)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("TietHoc_ID");
						if (!r.IsDBNull(ordinal)) entity.TietHoc_ID = ((int)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("TuanHoc_ID");
						if (!r.IsDBNull(ordinal)) entity.TuanHoc_ID = ((int)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("ThuTrongTuan_ID");
						if (!r.IsDBNull(ordinal)) entity.ThuTrongTuan_ID = ((int)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("PhongHoc_ID");
						if (!r.IsDBNull(ordinal)) entity.PhongHoc_ID = ((int)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("GiangVienLopTinChi_ID");
						if (!r.IsDBNull(ordinal)) entity.GiangVienLopTinChi_ID = ((int)(r.GetValue(ordinal)));
					}
					catch{}
					return entity;
				}
			}catch{}
			return null;
		}
		#endregion
	}
	/*****************************************************************************************************/
	/**********************************END LichHocLopTinChiDAOBase*****************************************/
	/*****************************************************************************************************/
}

